# !/usr/bin    python3
# encoding:    utf-8 -*-
# @file        : login_apis.py
# @author      : 加强 jqlin
# @Time        : 2025/9/30 13:48
# @Copyright:  : 接口自动化
from api.base_api import BaseBuyerApi
from common.encry_decry import md5


class BuyerLoginApi(BaseBuyerApi):
    # 接口的基本信息，统一封装在init函数中
    def __init__(self,username,password):
        super().__init__()
        self.url = f'{self.host}/passport/login' # self.host的值来自父类 BaseBuyerApi
        self.method = 'post'
        self.data = {
            "username":username,
            "password":md5(password),
            "captcha":"1512",
            "uuid":"fdasfadfdsfadsfasdfa"
        }

resp = BuyerLoginApi(username='mtx-001',password='e10adc3949ba59abbe56e057f20f883e').send()

# 接口 返回400 调试
# print(f'登录接口响应状态码:{resp.status_code}')
# print(f"登录接口响应内容:{resp.json}")